import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		int i=0,j=0,sum=0,k;
		char q;
		String s[]=new String[50];
		String y[]=new String[50];
		Scanner a=new Scanner(System.in);
		while(true)
		{
			y[i]=a.nextLine();
			if(y[i].equals("end"))
				break;
			else			
				i++;		
		}
		i=0;
		while(!y[i].equals("end"))
		{
			s=y[i].split(" ");
			for(j=0;j<s.length;j++)
			{
				for(k=0;k<s[j].length();k++)
				{
					q=s[j].charAt(k);
					if((q>='a'&&q<='z')||(q>='A'&&q<='Z'))
						sum++;
				    if((q>='0'&&q<='9'))
						System.out.print(q);
				}
			}
			y[i]=y[i].replaceAll("the","a");
			i++;
		}
		i=0;
		while(!y[i].equals("end"))
		{
			System.out.println(y[i]);
			i++;
		}
		System.out.println(sum);
	}
}